package cn.toesbieya.jxc.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.File;
import java.util.List;

@Service
public class FileService {

    @Value("${path.demo}")
    private String basePath;

    // 删除单一文件
    public void delete(String url) {
        try {
            String path=basePath+url;
            File file = new File(path);
            file.delete();
        } catch (Exception e) {
            System.out.println("删除文件失败");
            e.printStackTrace();
        }
    }

    public void deleteBatch(String[] urls) {

    }
}
